package ca.usherbrooke.domus.sipnmove2.view.call;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JTextField;

import ca.usherbrooke.domus.sipnmove2.controller.ActionController;

/**
 * Message text field for call view
 */
@SuppressWarnings("serial")
public class MessageTextField extends JTextField implements ActionListener {

	/**
	 * Controller for message sending
	 */
	private ActionController actionController; 
	
	/**
	 * Default constructor
	 */
	public MessageTextField() {
		this.setEditable(true);
		
		this.addActionListener(this);
	}

	@Override
	public void actionPerformed(ActionEvent actionEvent) {
		actionController.doAction();
	}

	/**
	 * @return the actionController
	 */
	public ActionController getActionController() {
		return actionController;
	}

	/**
	 * @param actionController the actionController to set
	 */
	public void setActionController(ActionController actionController) {
		this.actionController = actionController;
	}

}
